/*
 *  Copyright (C) 2009  Peter Kist & Jan Ripke
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef __world_property
#define __world_property 1

#include <string>

namespace galaxy {

	namespace world {

		class Entity;

		class Property
		{
			Entity * owner;

        public:

            typedef std::string const Type;

		public:
			Property();
			~Property(void);

            virtual Type& propertyType () = 0;

			/** creates a new property. For example:
			* \code
			* Property * TstProperty::clone() {
			*   TstProperty * p = new TstProperty ();
			*   p->x = x;
			*   return p;
			* }
			* \endcode
			* @post cloning the property does not set its owning entity.
			* @return a newly created property
			*/
			virtual Property * clone() = 0;

			/** set property's owning entity */
			Entity * getOwner () { return owner; };
			/** set property's owning entity */
			void setOwner (Entity& entity) { owner = &entity; };
		};

	}
}

#endif // __world_property //

